<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div style="margin: 100px auto; width: 500px">
      <form action="">
        <!-- id 和for一对,用于聚焦 -->
        <label for="name">账户：</label>
        <input type="text" id="name" name="name" required />
        <br />
        <label for="password">密码：</label>
        <input type="password" id="password" name="password" required />
        <br />
        <label for="sex">性别：</label>
        <input type="radio" id="sex" name="sex" value="1" /><span>男</span>
        <input type="radio" id="sex" name="sex" value="0" /> <span>女</span>
        <br />
        <label for="like">爱好：</label>
        <input type="checkbox" id="like" name="like" value="1" /><span
          >学习</span
        >
        <input type="checkbox" id="like" name="like" value="2" />
        <span>学习</span>
        <input type="checkbox" id="like" name="like" value="3" /><span
          >还是踏马的学习</span
        >
        <br />
        <!-- 隐藏域  可以提供默认值或者防止脚本攻击,有隐藏参数可能就无法使其注册成功 -->
        <input type="hidden" value="1231" />
        <label for="password">其他：</label>
        <input type="password" id="name" name="name" required />
        <br />
        <!-- 直接包进去不用写for了 -->
        <label
          >籍贯：
          <input name="name" required />
        </label>

        <br />
        <br />
        <button>确认</button>
        <button>重置</button>
        <button>检测用户是否被注册</button>
      </form>
    </div>
  </body>
</html>
